package towerDefense.screens;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import util.BufferedImageModifier;
import com.golden.gamedev.GameEngine;
import com.golden.gamedev.GameObject;


public abstract class MenuScreen extends GameObject
{

    public MenuScreen (GameEngine arg0)
    {
        super(arg0);
    }


    /**
     * @return
     * @throws IOException
     */
    protected BufferedImage createMenuItem (String filepath, int f)
        throws IOException
    {
        BufferedImage temp = ImageIO.read(new File(filepath));
        return BufferedImageModifier.getScaledInstance(temp,
                                                       (int) Math.ceil((getHeight() /
                                                                        f *
                                                                        (double) temp.getWidth() / temp.getHeight())),
                                                       getHeight() / f);
    }
}
